﻿@model IEnumerable<ProjectTracker.Library.ProjectResourceEdit>

@{
  ViewBag.Title = "Resources for '" + @ViewData["Title"] + "'";
}

<h2>@ViewBag.Title</h2>

<p>
    @Html.ActionLink("Add New", "Create", new { projectId = ViewData["ProjectId"] })
</p>
<table>
    <tr>
        <th></th>
        <th>
            Name
        </th>
        <th>
            Assigned
        </th>
        <th>
            Role
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { projectId=ViewData["ProjectId"], resourceId=item.ResourceId }) |
            @Html.ActionLink("Delete", "Delete", new { projectId = ViewData["ProjectId"], resourceId = item.ResourceId })
        </td>
        <td>
            @item.FullName
        </td>
        <td>
            @item.Assigned.ToShortDateString()
        </td>
        <td>
            @item.RoleName
        </td>
    </tr>
}

</table>
<div>
  @Html.ActionLink("Back to Project", "Edit", "Project", new { id = ViewData["ProjectId"] }, null)
</div>

